(include 'gui/view/class.inc)
(include 'sys/list/class.inc)

(def-class 'canvas 'view)
(dec-method 'vtable 'gui/canvas/vtable)
(dec-method 'create 'gui/canvas/create 'static '(r0 r1 r2) '(r0))
(dec-method 'create_shared 'gui/canvas/create_shared 'static '(r0) '(r0))
(dec-method 'init 'gui/canvas/init 'static '(r0 r1 r2 r3 r4) '(r0 r1))
(dec-method 'init_shared 'gui/canvas/init_shared 'static '(r0 r1 r2) '(r0 r1))
(dec-method 'swap 'gui/canvas/swap 'static '(r0) '(r0))
(dec-method 'resize 'gui/canvas/resize 'static '(r0 r1) '(r0))
(dec-method 'resize_2 'gui/canvas/resize_2 'static '(r0 r1) '(r0))
(dec-method 'resize_3 'gui/canvas/resize_3 'static '(r0 r1) '(r0))
(dec-method 'fill 'gui/canvas/fill 'static '(r0 r1) '(r0))
(dec-method 'to_premul 'gui/canvas/to_premul 'static '(r1) '(r1))
(dec-method 'to_argb 'gui/canvas/to_argb 'static '(r1) '(r1))
(dec-method 'as_argb 'gui/canvas/as_argb 'static '(r0 r1) '(r0))
(dec-method 'as_premul 'gui/canvas/as_premul 'static '(r0 r1) '(r0))
(dec-method 'set_clip 'gui/canvas/set_clip 'static '(r0 r7 r8 r9 r10) '(r0))
(dec-method 'set_edges 'gui/canvas/set_edges 'static '(r0 r1 r2 r3 r4) '(r0 r1 r2 r3 r4))
(dec-method 'span_noclip 'gui/canvas/span_noclip 'static '(r0 r1 r7 r8 r9) '(r0))
(dec-method 'span 'gui/canvas/span 'static '(r0 r1 r7 r8 r9) '(r0))
(dec-method 'pick 'gui/canvas/pick 'static '(r0 r7 r8) '(r0 r1))
(dec-method 'plot 'gui/canvas/plot 'static '(r0 r7 r8) '(r0))
(dec-method 'fbox 'gui/canvas/fbox 'static '(r0 r7 r8 r9 r10) '(r0))
(dec-method 'fpoly 'gui/canvas/fpoly 'static '(r0 r1 r2 r3 r4) '(r0))

(dec-method 'info 'gui/canvas/info 'static '(r0) '(r0 r1 r2))
(dec-method 'info_file 'gui/canvas/info_file 'static '(r4 r5) '(r0 r1 r2))
(dec-method 'info_cpm 'gui/canvas/info_cpm 'static '(r5) '(r0 r1 r2))
(dec-method 'info_tga 'gui/canvas/info_tga 'static '(r5) '(r0 r1 r2))

(dec-method 'load 'gui/canvas/load 'static '(r0 r1) '(r0))
(dec-method 'load_file 'gui/canvas/load_file 'static '(r4 r5) '(r0))
(dec-method 'load_cpm 'gui/canvas/load_cpm 'static '(r5) '(r0))
(dec-method 'load_tga 'gui/canvas/load_tga 'static '(r5) '(r0))
(dec-method 'to_argb32 'gui/canvas/to_argb32 'static '(r1 r2) '(r1))
(dec-method 'next_frame 'gui/canvas/next_frame 'static '(r0) '(r0))

(dec-method 'save 'gui/canvas/save 'static '(r0 r1 r2) '(r0))
(dec-method 'save_file 'gui/canvas/save_file 'static '(r4 r5 r6 r7) '(r0))
(dec-method 'save_cpm 'gui/canvas/save_cpm 'static '(r4 r6 r7) '(r0))
(dec-method 'from_argb32 'gui/canvas/from_argb32 'static '(r1 r2) '(r1))

(dec-method 'deinit 'gui/canvas/deinit 'override)
(dec-method 'pref_size 'gui/canvas/pref_size 'override)
(dec-method 'draw 'gui/canvas/draw 'override)

(dec-method 'lisp_create 'gui/canvas/lisp_create 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_info 'gui/canvas/lisp_info 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_load 'gui/canvas/lisp_load 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_save 'gui/canvas/lisp_save 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_next_frame 'gui/canvas/lisp_next_frame 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_swap 'gui/canvas/lisp_swap 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_fill 'gui/canvas/lisp_fill 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_plot 'gui/canvas/lisp_plot 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_fbox 'gui/canvas/lisp_fbox 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_fpoly 'gui/canvas/lisp_fpoly 'static '(r0 r1) '(r0 r1))
(dec-method 'lisp_resize 'gui/canvas/lisp_resize 'static '(r0 r1) '(r0 r1))

(def-struct 'canvas 'view)
	(ptr 'array 'edges 'texture)
	(pptr 'edges_start)
	(pubyte 'coverage)
	(ptr 'stream 'bufp)
	(uint 'scale 'width 'height 'stride 'stream_type 'cx 'cy 'cx1 'cy1 'color 'flags)
(def-struct-end)

(def-struct 'edge 'ln_fnode)
	(int 'x 'ys 'ye 'w 'dda)
	(local-align)
(def-struct-end)

(def-bit 'load_flag)
	(bit 'shared 'film 'noswap)
(def-bit-end)
